﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.UserRoleCommand;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.UserRoleHandler
{
    public class UserRoleDeleteCommandHandler:IRequestHandler<UserRoleDeleteCommand,int>
    {
        IUserRoleService urSer;

        public UserRoleDeleteCommandHandler(IUserRoleService urSer)
        {
            this.urSer = urSer;
        }

        public async Task<int> Handle(UserRoleDeleteCommand request, CancellationToken cancellationToken)
        {
            return await urSer.DelUserRole(request.Uid, request.Rid);
        }
    }
}
